<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    

    <script>
        let x = 1, y = 2;
        [x, y] = [y, x];  // 交换 x 和 y 的值
        console.log(x, y);  // 2 1


        //1.使用多行字符串
        //普通的字符串不支持换行拼接 +自行连接
        let ulStr = '<ul>'+
                     '<li>呵呵</li>'+
                     '<li>哈哈</li>'+
                    '</ul>';  //""  ''

        //普通字符换 "" '' || 模板字符串 `` 1左边那个            
        let ulStr1 = `1
                      2
                      3
                      4
                      5
                      6`;    

        //2.方便进行字符串拼接   
        //前端 -->  param(key=value)  path (/1/2) json (请求体)  -->  后端   
        let id = 1;
        let type =2;
        let path = "http://admin.lease.atguigu.com/admin/apartment?id="+id+"&type="+type;   

        let pathTemplate = `http://admin.lease.atguigu.com/admin/apartment?id=${id}&type=${type}`;   
        let path1 = "http://admin.lease.atguigu.com/admin/"+id+"/"+type+"/search";      
        let path1template = `http://admin.lease.atguigu.com/admin/${id}/${type}/search`;      


    </script>


</body>
</html>